package com.itheima.web;

import com.itheima.domain.User;
import com.itheima.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping("/user")
public class controller {
    @Autowired
    private UserService userService;
    @RequestMapping("/show")
   @ResponseBody
    public String show1(Model model){
        User byId = userService.findById(5);
        model.addAttribute("user",byId);
        return "show";
    }
}
